package com.telecom.restaurant.dao;

import com.telecom.restaurant.model.CustomerCouponUsePO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface CustomerCouponUseDao {
    int deleteByPrimaryKey(Long id);

    int insert(CustomerCouponUsePO record);

    int insertSelective(CustomerCouponUsePO record);

    CustomerCouponUsePO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CustomerCouponUsePO record);

    int updateOrderId(CustomerCouponUsePO record);

    int updateUnused(@Param("customerId") Long customerId,
                     @Param("orderId") Long OrderId);

    List<CustomerCouponUsePO> getByCustomerAndDate(@Param("customerId") Long customerId,
                                                   @Param("orderDate") Date date);

    int countUsed(@Param("customerId") Long customerId,
                  @Param("orderDate") Date date);
}